3.2.35 \(\int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx\) [135]

3.2.35.1 Optimal result
3.2.35.2 Mathematica [A] (verified)
3.2.35.3 Rubi [A] (verified)
3.2.35.4 Maple [B] (verified)
3.2.35.5 Fricas [B] (verification not implemented)
3.2.35.6 Sympy [F(-2)]
3.2.35.7 Maxima [F]
3.2.35.8 Giac [F]
3.2.35.9 Mupad [B] (verification not implemented)

3.2.35.1 Optimal result

Integrand size = 24, antiderivative size = 188 \[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=-\frac {(d g-c h) (c+d x)^{-3-m} (e+f x)^{1+m}}{d (d e-c f) (3+m)}+\frac {(c f h (1+m)+d (2 f g-e h (3+m))) (c+d x)^{-2-m} (e+f x)^{1+m}}{d (d e-c f)^2 (2+m) (3+m)}-\frac {f (c f h (1+m)+d (2 f g-e h (3+m))) (c+d x)^{-1-m} (e+f x)^{1+m}}{d (d e-c f)^3 (1+m) (2+m) (3+m)} \]

output
-(-c*h+d*g)*(d*x+c)^(-3-m)*(f*x+e)^(1+m)/d/(-c*f+d*e)/(3+m)+(c*f*h*(1+m)+d 
*(2*f*g-e*h*(3+m)))*(d*x+c)^(-2-m)*(f*x+e)^(1+m)/d/(-c*f+d*e)^2/(2+m)/(3+m 
)-f*(c*f*h*(1+m)+d*(2*f*g-e*h*(3+m)))*(d*x+c)^(-1-m)*(f*x+e)^(1+m)/d/(-c*f 
+d*e)^3/(1+m)/(2+m)/(3+m)
 
3.2.35.2 Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 181, normalized size of antiderivative = 0.96 \[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\frac {(d g-c h) (c+d x)^{-3-m} (e+f x)^{1+m}}{d (d e-c f) (-3-m)}-\frac {(-2 d f g-h (d e (-3-m)+c f (1+m))) \left (\frac {(c+d x)^{-2-m} (e+f x)^{1+m}}{(d e-c f) (-2-m)}+\frac {f (c+d x)^{-1-m} (e+f x)^{1+m}}{(d e-c f)^2 (-2-m) (-1-m)}\right )}{d (d e-c f) (-3-m)} \]

input
Integrate[(c + d*x)^(-4 - m)*(e + f*x)^m*(g + h*x),x]
 
output
((d*g - c*h)*(c + d*x)^(-3 - m)*(e + f*x)^(1 + m))/(d*(d*e - c*f)*(-3 - m) 
) - ((-2*d*f*g - h*(d*e*(-3 - m) + c*f*(1 + m)))*(((c + d*x)^(-2 - m)*(e + 
 f*x)^(1 + m))/((d*e - c*f)*(-2 - m)) + (f*(c + d*x)^(-1 - m)*(e + f*x)^(1 
 + m))/((d*e - c*f)^2*(-2 - m)*(-1 - m))))/(d*(d*e - c*f)*(-3 - m))
 
3.2.35.3 Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 170, normalized size of antiderivative = 0.90, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {88, 55, 48}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (g+h x) (c+d x)^{-m-4} (e+f x)^m \, dx\)

\(\Big \downarrow \) 88

\(\displaystyle -\frac {(c f h (m+1)-d e h (m+3)+2 d f g) \int (c+d x)^{-m-3} (e+f x)^mdx}{d (m+3) (d e-c f)}-\frac {(d g-c h) (c+d x)^{-m-3} (e+f x)^{m+1}}{d (m+3) (d e-c f)}\)

\(\Big \downarrow \) 55

\(\displaystyle -\frac {(c f h (m+1)-d e h (m+3)+2 d f g) \left (-\frac {f \int (c+d x)^{-m-2} (e+f x)^mdx}{(m+2) (d e-c f)}-\frac {(c+d x)^{-m-2} (e+f x)^{m+1}}{(m+2) (d e-c f)}\right )}{d (m+3) (d e-c f)}-\frac {(d g-c h) (c+d x)^{-m-3} (e+f x)^{m+1}}{d (m+3) (d e-c f)}\)

\(\Big \downarrow \) 48

\(\displaystyle -\frac {(d g-c h) (c+d x)^{-m-3} (e+f x)^{m+1}}{d (m+3) (d e-c f)}-\frac {\left (\frac {f (c+d x)^{-m-1} (e+f x)^{m+1}}{(m+1) (m+2) (d e-c f)^2}-\frac {(c+d x)^{-m-2} (e+f x)^{m+1}}{(m+2) (d e-c f)}\right ) (c f h (m+1)-d e h (m+3)+2 d f g)}{d (m+3) (d e-c f)}\)

input
Int[(c + d*x)^(-4 - m)*(e + f*x)^m*(g + h*x),x]
 
output
-(((d*g - c*h)*(c + d*x)^(-3 - m)*(e + f*x)^(1 + m))/(d*(d*e - c*f)*(3 + m 
))) - ((2*d*f*g + c*f*h*(1 + m) - d*e*h*(3 + m))*(-(((c + d*x)^(-2 - m)*(e 
 + f*x)^(1 + m))/((d*e - c*f)*(2 + m))) + (f*(c + d*x)^(-1 - m)*(e + f*x)^ 
(1 + m))/((d*e - c*f)^2*(1 + m)*(2 + m))))/(d*(d*e - c*f)*(3 + m))
 

3.2.35.3.1 Defintions of rubi rules used

rule 48
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp 
[(a + b*x)^(m + 1)*((c + d*x)^(n + 1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{ 
a, b, c, d, m, n}, x] && EqQ[m + n + 2, 0] && NeQ[m, -1]
 

rule 55
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[ 
(a + b*x)^(m + 1)*((c + d*x)^(n + 1)/((b*c - a*d)*(m + 1))), x] - Simp[d*(S 
implify[m + n + 2]/((b*c - a*d)*(m + 1)))   Int[(a + b*x)^Simplify[m + 1]*( 
c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && ILtQ[Simplify[m + n + 
 2], 0] && NeQ[m, -1] &&  !(LtQ[m, -1] && LtQ[n, -1] && (EqQ[a, 0] || (NeQ[ 
c, 0] && LtQ[m - n, 0] && IntegerQ[n]))) && (SumSimplerQ[m, 1] ||  !SumSimp 
lerQ[n, 1])
 

rule 88
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p 
_.), x_] :> Simp[(-(b*e - a*f))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p 
+ 1)*(c*f - d*e))), x] - Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p 
+ 1)))/(f*(p + 1)*(c*f - d*e))   Int[(c + d*x)^n*(e + f*x)^Simplify[p + 1], 
 x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] &&  !RationalQ[p] && SumSimpl 
erQ[p, 1]
 
3.2.35.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(508\) vs. \(2(188)=376\).

Time = 1.92 (sec) , antiderivative size = 509, normalized size of antiderivative = 2.71

method result size
gosper \(-\frac {\left (d x +c \right )^{-3-m} \left (f x +e \right )^{1+m} \left (-c^{2} f^{2} h \,m^{2} x +2 c d e f h \,m^{2} x -c d \,f^{2} h m \,x^{2}-d^{2} e^{2} h \,m^{2} x +d^{2} e f h m \,x^{2}-c^{2} f^{2} g \,m^{2}-4 c^{2} f^{2} h m x +2 c d e f g \,m^{2}+8 c d e f h m x -2 c d \,f^{2} g m x -c d \,f^{2} h \,x^{2}-d^{2} e^{2} g \,m^{2}-4 d^{2} e^{2} h m x +2 d^{2} e f g m x +3 d^{2} e f h \,x^{2}-2 d^{2} f^{2} g \,x^{2}+c^{2} e f h m -5 c^{2} f^{2} g m -3 c^{2} f^{2} h x -c d \,e^{2} h m +8 c d e f g m +10 c d e f h x -6 c d \,f^{2} g x -3 d^{2} e^{2} g m -3 d^{2} e^{2} h x +2 d^{2} e f g x +3 c^{2} e f h -6 c^{2} f^{2} g -c d \,e^{2} h +6 c d e f g -2 d^{2} e^{2} g \right )}{c^{3} f^{3} m^{3}-3 c^{2} d e \,f^{2} m^{3}+3 c \,d^{2} e^{2} f \,m^{3}-d^{3} e^{3} m^{3}+6 c^{3} f^{3} m^{2}-18 c^{2} d e \,f^{2} m^{2}+18 c \,d^{2} e^{2} f \,m^{2}-6 d^{3} e^{3} m^{2}+11 c^{3} f^{3} m -33 c^{2} d e \,f^{2} m +33 c \,d^{2} e^{2} f m -11 d^{3} e^{3} m +6 c^{3} f^{3}-18 c^{2} d e \,f^{2}+18 c \,d^{2} e^{2} f -6 d^{3} e^{3}}\) \(509\)
parallelrisch \(\text {Expression too large to display}\) \(2394\)

input
int((d*x+c)^(-4-m)*(f*x+e)^m*(h*x+g),x,method=_RETURNVERBOSE)
 
output
-(d*x+c)^(-3-m)*(f*x+e)^(1+m)/(c^3*f^3*m^3-3*c^2*d*e*f^2*m^3+3*c*d^2*e^2*f 
*m^3-d^3*e^3*m^3+6*c^3*f^3*m^2-18*c^2*d*e*f^2*m^2+18*c*d^2*e^2*f*m^2-6*d^3 
*e^3*m^2+11*c^3*f^3*m-33*c^2*d*e*f^2*m+33*c*d^2*e^2*f*m-11*d^3*e^3*m+6*c^3 
*f^3-18*c^2*d*e*f^2+18*c*d^2*e^2*f-6*d^3*e^3)*(-c^2*f^2*h*m^2*x+2*c*d*e*f* 
h*m^2*x-c*d*f^2*h*m*x^2-d^2*e^2*h*m^2*x+d^2*e*f*h*m*x^2-c^2*f^2*g*m^2-4*c^ 
2*f^2*h*m*x+2*c*d*e*f*g*m^2+8*c*d*e*f*h*m*x-2*c*d*f^2*g*m*x-c*d*f^2*h*x^2- 
d^2*e^2*g*m^2-4*d^2*e^2*h*m*x+2*d^2*e*f*g*m*x+3*d^2*e*f*h*x^2-2*d^2*f^2*g* 
x^2+c^2*e*f*h*m-5*c^2*f^2*g*m-3*c^2*f^2*h*x-c*d*e^2*h*m+8*c*d*e*f*g*m+10*c 
*d*e*f*h*x-6*c*d*f^2*g*x-3*d^2*e^2*g*m-3*d^2*e^2*h*x+2*d^2*e*f*g*x+3*c^2*e 
*f*h-6*c^2*f^2*g-c*d*e^2*h+6*c*d*e*f*g-2*d^2*e^2*g)
 
3.2.35.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 905 vs. \(2 (188) = 376\).

Time = 0.27 (sec) , antiderivative size = 905, normalized size of antiderivative = 4.81 \[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=-\frac {{\left ({\left (2 \, d^{3} f^{3} g - {\left (d^{3} e f^{2} - c d^{2} f^{3}\right )} h m - {\left (3 \, d^{3} e f^{2} - c d^{2} f^{3}\right )} h\right )} x^{4} + {\left (c d^{2} e^{3} - 2 \, c^{2} d e^{2} f + c^{3} e f^{2}\right )} g m^{2} + {\left (8 \, c d^{2} f^{3} g + {\left (d^{3} e^{2} f - 2 \, c d^{2} e f^{2} + c^{2} d f^{3}\right )} h m^{2} - 4 \, {\left (3 \, c d^{2} e f^{2} - c^{2} d f^{3}\right )} h - {\left (2 \, {\left (d^{3} e f^{2} - c d^{2} f^{3}\right )} g - {\left (3 \, d^{3} e^{2} f - 8 \, c d^{2} e f^{2} + 5 \, c^{2} d f^{3}\right )} h\right )} m\right )} x^{3} + {\left (12 \, c^{2} d f^{3} g + {\left ({\left (d^{3} e^{2} f - 2 \, c d^{2} e f^{2} + c^{2} d f^{3}\right )} g + {\left (d^{3} e^{3} - c d^{2} e^{2} f - c^{2} d e f^{2} + c^{3} f^{3}\right )} h\right )} m^{2} + 3 \, {\left (d^{3} e^{3} - 3 \, c d^{2} e^{2} f - 3 \, c^{2} d e f^{2} + c^{3} f^{3}\right )} h + {\left ({\left (d^{3} e^{2} f - 8 \, c d^{2} e f^{2} + 7 \, c^{2} d f^{3}\right )} g + 4 \, {\left (d^{3} e^{3} - c d^{2} e^{2} f - c^{2} d e f^{2} + c^{3} f^{3}\right )} h\right )} m\right )} x^{2} + 2 \, {\left (c d^{2} e^{3} - 3 \, c^{2} d e^{2} f + 3 \, c^{3} e f^{2}\right )} g + {\left (c^{2} d e^{3} - 3 \, c^{3} e^{2} f\right )} h + {\left ({\left (3 \, c d^{2} e^{3} - 8 \, c^{2} d e^{2} f + 5 \, c^{3} e f^{2}\right )} g + {\left (c^{2} d e^{3} - c^{3} e^{2} f\right )} h\right )} m + {\left ({\left ({\left (d^{3} e^{3} - c d^{2} e^{2} f - c^{2} d e f^{2} + c^{3} f^{3}\right )} g + {\left (c d^{2} e^{3} - 2 \, c^{2} d e^{2} f + c^{3} e f^{2}\right )} h\right )} m^{2} + 2 \, {\left (d^{3} e^{3} - 3 \, c d^{2} e^{2} f + 3 \, c^{2} d e f^{2} + 3 \, c^{3} f^{3}\right )} g + 4 \, {\left (c d^{2} e^{3} - 3 \, c^{2} d e^{2} f\right )} h + {\left ({\left (3 \, d^{3} e^{3} - 7 \, c d^{2} e^{2} f - c^{2} d e f^{2} + 5 \, c^{3} f^{3}\right )} g + {\left (5 \, c d^{2} e^{3} - 8 \, c^{2} d e^{2} f + 3 \, c^{3} e f^{2}\right )} h\right )} m\right )} x\right )} {\left (d x + c\right )}^{-m - 4} {\left (f x + e\right )}^{m}}{6 \, d^{3} e^{3} - 18 \, c d^{2} e^{2} f + 18 \, c^{2} d e f^{2} - 6 \, c^{3} f^{3} + {\left (d^{3} e^{3} - 3 \, c d^{2} e^{2} f + 3 \, c^{2} d e f^{2} - c^{3} f^{3}\right )} m^{3} + 6 \, {\left (d^{3} e^{3} - 3 \, c d^{2} e^{2} f + 3 \, c^{2} d e f^{2} - c^{3} f^{3}\right )} m^{2} + 11 \, {\left (d^{3} e^{3} - 3 \, c d^{2} e^{2} f + 3 \, c^{2} d e f^{2} - c^{3} f^{3}\right )} m} \]

input
integrate((d*x+c)^(-4-m)*(f*x+e)^m*(h*x+g),x, algorithm="fricas")
 
output
-((2*d^3*f^3*g - (d^3*e*f^2 - c*d^2*f^3)*h*m - (3*d^3*e*f^2 - c*d^2*f^3)*h 
)*x^4 + (c*d^2*e^3 - 2*c^2*d*e^2*f + c^3*e*f^2)*g*m^2 + (8*c*d^2*f^3*g + ( 
d^3*e^2*f - 2*c*d^2*e*f^2 + c^2*d*f^3)*h*m^2 - 4*(3*c*d^2*e*f^2 - c^2*d*f^ 
3)*h - (2*(d^3*e*f^2 - c*d^2*f^3)*g - (3*d^3*e^2*f - 8*c*d^2*e*f^2 + 5*c^2 
*d*f^3)*h)*m)*x^3 + (12*c^2*d*f^3*g + ((d^3*e^2*f - 2*c*d^2*e*f^2 + c^2*d* 
f^3)*g + (d^3*e^3 - c*d^2*e^2*f - c^2*d*e*f^2 + c^3*f^3)*h)*m^2 + 3*(d^3*e 
^3 - 3*c*d^2*e^2*f - 3*c^2*d*e*f^2 + c^3*f^3)*h + ((d^3*e^2*f - 8*c*d^2*e* 
f^2 + 7*c^2*d*f^3)*g + 4*(d^3*e^3 - c*d^2*e^2*f - c^2*d*e*f^2 + c^3*f^3)*h 
)*m)*x^2 + 2*(c*d^2*e^3 - 3*c^2*d*e^2*f + 3*c^3*e*f^2)*g + (c^2*d*e^3 - 3* 
c^3*e^2*f)*h + ((3*c*d^2*e^3 - 8*c^2*d*e^2*f + 5*c^3*e*f^2)*g + (c^2*d*e^3 
 - c^3*e^2*f)*h)*m + (((d^3*e^3 - c*d^2*e^2*f - c^2*d*e*f^2 + c^3*f^3)*g + 
 (c*d^2*e^3 - 2*c^2*d*e^2*f + c^3*e*f^2)*h)*m^2 + 2*(d^3*e^3 - 3*c*d^2*e^2 
*f + 3*c^2*d*e*f^2 + 3*c^3*f^3)*g + 4*(c*d^2*e^3 - 3*c^2*d*e^2*f)*h + ((3* 
d^3*e^3 - 7*c*d^2*e^2*f - c^2*d*e*f^2 + 5*c^3*f^3)*g + (5*c*d^2*e^3 - 8*c^ 
2*d*e^2*f + 3*c^3*e*f^2)*h)*m)*x)*(d*x + c)^(-m - 4)*(f*x + e)^m/(6*d^3*e^ 
3 - 18*c*d^2*e^2*f + 18*c^2*d*e*f^2 - 6*c^3*f^3 + (d^3*e^3 - 3*c*d^2*e^2*f 
 + 3*c^2*d*e*f^2 - c^3*f^3)*m^3 + 6*(d^3*e^3 - 3*c*d^2*e^2*f + 3*c^2*d*e*f 
^2 - c^3*f^3)*m^2 + 11*(d^3*e^3 - 3*c*d^2*e^2*f + 3*c^2*d*e*f^2 - c^3*f^3) 
*m)
 
3.2.35.6 Sympy [F(-2)]

Exception generated. \[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\text {Exception raised: HeuristicGCDFailed} \]

input
integrate((d*x+c)**(-4-m)*(f*x+e)**m*(h*x+g),x)
 
output
Exception raised: HeuristicGCDFailed >> no luck
 
3.2.35.7 Maxima [F]

\[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\int { {\left (h x + g\right )} {\left (d x + c\right )}^{-m - 4} {\left (f x + e\right )}^{m} \,d x } \]

input
integrate((d*x+c)^(-4-m)*(f*x+e)^m*(h*x+g),x, algorithm="maxima")
 
output
integrate((h*x + g)*(d*x + c)^(-m - 4)*(f*x + e)^m, x)
 
3.2.35.8 Giac [F]

\[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\int { {\left (h x + g\right )} {\left (d x + c\right )}^{-m - 4} {\left (f x + e\right )}^{m} \,d x } \]

input
integrate((d*x+c)^(-4-m)*(f*x+e)^m*(h*x+g),x, algorithm="giac")
 
output
integrate((h*x + g)*(d*x + c)^(-m - 4)*(f*x + e)^m, x)
 
3.2.35.9 Mupad [B] (verification not implemented)

Time = 3.67 (sec) , antiderivative size = 869, normalized size of antiderivative = 4.62 \[ \int (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\frac {x^2\,{\left (e+f\,x\right )}^m\,\left (h\,c^3\,f^3\,m^2+4\,h\,c^3\,f^3\,m+3\,h\,c^3\,f^3-h\,c^2\,d\,e\,f^2\,m^2-4\,h\,c^2\,d\,e\,f^2\,m-9\,h\,c^2\,d\,e\,f^2+g\,c^2\,d\,f^3\,m^2+7\,g\,c^2\,d\,f^3\,m+12\,g\,c^2\,d\,f^3-h\,c\,d^2\,e^2\,f\,m^2-4\,h\,c\,d^2\,e^2\,f\,m-9\,h\,c\,d^2\,e^2\,f-2\,g\,c\,d^2\,e\,f^2\,m^2-8\,g\,c\,d^2\,e\,f^2\,m+h\,d^3\,e^3\,m^2+4\,h\,d^3\,e^3\,m+3\,h\,d^3\,e^3+g\,d^3\,e^2\,f\,m^2+g\,d^3\,e^2\,f\,m\right )}{{\left (c\,f-d\,e\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )}+\frac {x\,{\left (e+f\,x\right )}^m\,\left (h\,c^3\,e\,f^2\,m^2+3\,h\,c^3\,e\,f^2\,m+g\,c^3\,f^3\,m^2+5\,g\,c^3\,f^3\,m+6\,g\,c^3\,f^3-2\,h\,c^2\,d\,e^2\,f\,m^2-8\,h\,c^2\,d\,e^2\,f\,m-12\,h\,c^2\,d\,e^2\,f-g\,c^2\,d\,e\,f^2\,m^2-g\,c^2\,d\,e\,f^2\,m+6\,g\,c^2\,d\,e\,f^2+h\,c\,d^2\,e^3\,m^2+5\,h\,c\,d^2\,e^3\,m+4\,h\,c\,d^2\,e^3-g\,c\,d^2\,e^2\,f\,m^2-7\,g\,c\,d^2\,e^2\,f\,m-6\,g\,c\,d^2\,e^2\,f+g\,d^3\,e^3\,m^2+3\,g\,d^3\,e^3\,m+2\,g\,d^3\,e^3\right )}{{\left (c\,f-d\,e\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )}+\frac {c\,e\,{\left (e+f\,x\right )}^m\,\left (-h\,c^2\,e\,f\,m-3\,h\,c^2\,e\,f+g\,c^2\,f^2\,m^2+5\,g\,c^2\,f^2\,m+6\,g\,c^2\,f^2+h\,c\,d\,e^2\,m+h\,c\,d\,e^2-2\,g\,c\,d\,e\,f\,m^2-8\,g\,c\,d\,e\,f\,m-6\,g\,c\,d\,e\,f+g\,d^2\,e^2\,m^2+3\,g\,d^2\,e^2\,m+2\,g\,d^2\,e^2\right )}{{\left (c\,f-d\,e\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )}+\frac {d^2\,f^2\,x^4\,{\left (e+f\,x\right )}^m\,\left (c\,f\,h-3\,d\,e\,h+2\,d\,f\,g+c\,f\,h\,m-d\,e\,h\,m\right )}{{\left (c\,f-d\,e\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )}+\frac {d\,f\,x^3\,{\left (e+f\,x\right )}^m\,\left (4\,c\,f+c\,f\,m-d\,e\,m\right )\,\left (c\,f\,h-3\,d\,e\,h+2\,d\,f\,g+c\,f\,h\,m-d\,e\,h\,m\right )}{{\left (c\,f-d\,e\right )}^3\,{\left (c+d\,x\right )}^{m+4}\,\left (m^3+6\,m^2+11\,m+6\right )} \]

input
int(((e + f*x)^m*(g + h*x))/(c + d*x)^(m + 4),x)
 
output
(x^2*(e + f*x)^m*(3*c^3*f^3*h + 3*d^3*e^3*h + c^3*f^3*h*m^2 + d^3*e^3*h*m^ 
2 + 12*c^2*d*f^3*g + 4*c^3*f^3*h*m + 4*d^3*e^3*h*m - 9*c*d^2*e^2*f*h - 9*c 
^2*d*e*f^2*h + 7*c^2*d*f^3*g*m + d^3*e^2*f*g*m + c^2*d*f^3*g*m^2 + d^3*e^2 
*f*g*m^2 - 8*c*d^2*e*f^2*g*m - 4*c*d^2*e^2*f*h*m - 4*c^2*d*e*f^2*h*m - 2*c 
*d^2*e*f^2*g*m^2 - c*d^2*e^2*f*h*m^2 - c^2*d*e*f^2*h*m^2))/((c*f - d*e)^3* 
(c + d*x)^(m + 4)*(11*m + 6*m^2 + m^3 + 6)) + (x*(e + f*x)^m*(6*c^3*f^3*g 
+ 2*d^3*e^3*g + c^3*f^3*g*m^2 + d^3*e^3*g*m^2 + 4*c*d^2*e^3*h + 5*c^3*f^3* 
g*m + 3*d^3*e^3*g*m - 6*c*d^2*e^2*f*g + 6*c^2*d*e*f^2*g - 12*c^2*d*e^2*f*h 
 + 5*c*d^2*e^3*h*m + 3*c^3*e*f^2*h*m + c*d^2*e^3*h*m^2 + c^3*e*f^2*h*m^2 - 
 7*c*d^2*e^2*f*g*m - c^2*d*e*f^2*g*m - 8*c^2*d*e^2*f*h*m - c*d^2*e^2*f*g*m 
^2 - c^2*d*e*f^2*g*m^2 - 2*c^2*d*e^2*f*h*m^2))/((c*f - d*e)^3*(c + d*x)^(m 
 + 4)*(11*m + 6*m^2 + m^3 + 6)) + (c*e*(e + f*x)^m*(6*c^2*f^2*g + 2*d^2*e^ 
2*g + c^2*f^2*g*m^2 + d^2*e^2*g*m^2 + c*d*e^2*h - 3*c^2*e*f*h + 5*c^2*f^2* 
g*m + 3*d^2*e^2*g*m - 6*c*d*e*f*g + c*d*e^2*h*m - c^2*e*f*h*m - 2*c*d*e*f* 
g*m^2 - 8*c*d*e*f*g*m))/((c*f - d*e)^3*(c + d*x)^(m + 4)*(11*m + 6*m^2 + m 
^3 + 6)) + (d^2*f^2*x^4*(e + f*x)^m*(c*f*h - 3*d*e*h + 2*d*f*g + c*f*h*m - 
 d*e*h*m))/((c*f - d*e)^3*(c + d*x)^(m + 4)*(11*m + 6*m^2 + m^3 + 6)) + (d 
*f*x^3*(e + f*x)^m*(4*c*f + c*f*m - d*e*m)*(c*f*h - 3*d*e*h + 2*d*f*g + c* 
f*h*m - d*e*h*m))/((c*f - d*e)^3*(c + d*x)^(m + 4)*(11*m + 6*m^2 + m^3 + 6 
))